package com.zz.springboot.mapper;

import com.zz.springboot.dto.UserDto;
import com.zz.springboot.model.SysUser;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface SysUserMapper extends Mapper<SysUser> {

    /**
     * 插入用户数据
     * @param userDto
     */
    Integer insertUserData(UserDto userDto);

    /**
     * 验证用户名唯一
     * @param username
     * @return
     */
    UserDto verifyOnlyUsername(String username);

    /**
     * 根据用户名查询用户信息
     * @param username
     * @return
     */
    UserDto selectUserByUsername(String username);

    /**
     * 根据用户名查询角色code
     * @param userName
     * @return
     */
    List<String> getRolesByUserName(String userName);

    /**
     * 根据用户名查询权限name
     * @param userName
     * @return
     */
    List<String> getPermissionsByUserName(String userName);

}